<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./MasterPageHome.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns="http://www.w3.org/1999/xhtml">
    <f:metadata>
        <f:viewParam name="idH" value="#{messageMB.idhouse}"/>
    </f:metadata>
    <ui:define name="Title">
        <title>View All My Mesages</title>
    </ui:define>

    <ui:define name="content">

        <h:form>
            <p:dataTable id="dataTable" var="message" value="#{messageMB.lh}" 

                         paginator="true" rows="10"  
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                         rowsPerPageTemplate="5,10,15">  
                <f:facet name="header">  
                    My Message 
                </f:facet>  
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Type" />  
                    </f:facet>  
                    <h:outputText value="#{message.typehouse}" />  
                </p:column> 

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Title" />  
                    </f:facet>  
                    <h:outputText value="#{message.tittlehouse}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Date Up" />  
                    </f:facet>  
                    <h:outputText value="#{message.dateUp}">
                        <f:convertDateTime pattern="MM/dd/yyyy"/>
                    </h:outputText>  
                </p:column> 

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Home Style" />  
                    </f:facet>  
                    <h:outputText value="#{message.homestyle}" />  
                </p:column> 

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="S-Q-Earth" />  
                    </f:facet>  
                    <h:outputText value="#{message.squarefootageEarth}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="S-Q-House" />  
                    </f:facet>  
                    <h:outputText value="#{message.squarefootageHouse}" />  
                </p:column>

                <p:column>
                    <a href="Editmessage.xhtml?id=#{message.idHouse}">Edit</a>
                </p:column>

                <p:column>
                    <p:commandLink id="buttondelete" onstart="return confirm('Are you sure?')" action="#{messageMB.deleteonehouse}" value="Delete">
                        <f:param name="idH" value="#{message.idHouse}"/>
                    </p:commandLink>
                </p:column>
            </p:dataTable> 
        </h:form>
    </ui:define>

</ui:composition>
